package cn.liberals.org.domain;

import cn.liberals.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor

/**
* @Description: TODO
* @Author: liberals
* @Version: 1.0
* @Date:  2022/6/21 21:43  
*/
public class Department extends BaseDomain {


    private String sn;
    private String name;
    private String dirPath;
    private Integer state;
    private Long managerId;;
    private Long parentId;;

    // 部门负责人
    private Employee manager;

    // 上级部门
    private Department parent;

    // 封装子部门集合字段
    @JsonInclude(JsonInclude.Include.NON_EMPTY) // 当数据不为空的时候才返回
    private List<Department> children = new ArrayList<>();

}
